print("[KKB]: Loading Client Plug-In..")

include("kkb/shared/shared.lua")

include("kkb/client/panel_group.lua")
include("kkb/client/panel_customusers.lua")
include("kkb/client/panel_toolguns.lua")
include("kkb/client/panel_vehicles.lua")
include("kkb/client/panel_entitys.lua")
include("kkb/client/panel_weapons.lua")
include("kkb/client/panel_npcs.lua")
include("kkb/client/panel_models.lua")
include("kkb/client/panel_buddies.lua")
include("kkb/client/panel_cleanup.lua")
include("kkb/client/panel_general.lua")
include("kkb/client/panel_damage.lua")

include("kkb/client/settings_reload.lua")

include("kkb/client/cppi.lua")

--Build The Panels Into Q Menu
function KKB.MakeMenus()
	spawnmenu.AddToolMenuOption( "Server", "KK's-Base", "Group Settings", "Group Settings", "", "", KKB.Panel_GroupSettings )
	spawnmenu.AddToolMenuOption( "Server", "KK's-Base", "Custom Users", "CustomUsers", "", "", KKB.Panel_CustomUsers )
	spawnmenu.AddToolMenuOption( "Server", "KK's-Base", "Toolguns", "Toolguns", "", "", KKB.Panel_Toolguns )
	spawnmenu.AddToolMenuOption( "Server", "KK's-Base", "Vehicles", "Vehicles", "", "", KKB.Panel_Vehicles )
	spawnmenu.AddToolMenuOption( "Server", "KK's-Base", "Entities", "Entities", "", "", KKB.Panel_Entitys )
	spawnmenu.AddToolMenuOption( "Server", "KK's-Base", "Weapons", "Weapons", "", "", KKB.Panel_Weapons )
	spawnmenu.AddToolMenuOption( "Server", "KK's-Base", "NPCs", "NPCs", "", "", KKB.Panel_NPCs )
	spawnmenu.AddToolMenuOption( "Server", "KK's-Base", "Models", "Models", "", "", KKB.Panel_Models )
	spawnmenu.AddToolMenuOption( "Server", "KK's-Base", "General Settings", "General Settings", "", "", KKB.Panel_General )
	spawnmenu.AddToolMenuOption( "Server", "KK's-Base", "Damage Control", "Damage Control", "", "", KKB.Panel_Damage )
	spawnmenu.AddToolMenuOption( "Utilities", "User", "KKB Buddies", "KKB Buddies", "", "", KKB.Panel_Buddies )
	spawnmenu.AddToolMenuOption( "Utilities", "Admin", "KKB Cleanup", "KKB Cleanup", "", "", KKB.Panel_Cleanup )
end
hook.Add("PopulateToolMenu", "KKB.MakeMenus", KKB.MakeMenus)

--HUD STUFF
function KKB.HUDPaint()
	local Entity = LocalPlayer():GetEyeTrace().Entity
	if ( not Entity:IsWorld() ) then
		local Name = Entity:GetNWString( "KKB_OwnerName" )
		if ( Name != "" ) then
			surface.SetFont( "Default" )
			local Width, Height = surface.GetTextSize(Name)
			draw.RoundedBox( 8, 5, (ScrH()/2)-((Height+10)/2), Width+20, Height+10, Color(0, 0, 0, 180) )
			draw.SimpleText(Name, "Default", 15, ScrH()/2, Color(255,255,255,255), TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER)
		end
	else
		surface.SetFont( "Default" )
		local Width, Height = surface.GetTextSize("World")
		draw.RoundedBox( 8, 5, (ScrH()/2)-((Height+10)/2), Width+20, Height+10, Color(0, 0, 0, 180) )
		draw.SimpleText("World", "Default", 15, ScrH()/2, Color(255,255,255,255), TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER)
	end
end
hook.Add("HUDPaint", "KKB.HUDPaint", KKB.HUDPaint)

print("[KKB]: Client Plug-In Loaded!")